package com.bw.controller;

import com.alibaba.fastjson.JSON;
import com.bw.entity.User;
import com.bw.mapper.UserMapper;
import org.apache.avro.data.Json;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
public class ListController {
    @Autowired
    UserMapper userMapper;

    // 列表页
    @RequestMapping("/list.do")
    public String list(Model model){

        List<User> list  = userMapper.listUser();
        model.addAttribute("list",list);

        return "list";
    }
}
